package jgl.vajra.operator.part.home.viewModel;

import java.util.Map;

import jgl.vajra.operator.bean.ListeningSettingBean;
import jgl.vajra.operator.part.home.contract.ListeningSettingContract;
import jgl.vajra.operator.part.home.model.ListeningSettingModel;
import jgl.vajra.operator.widget.mvvm.factory.CreateModel;
import jgl.vajra.operator.widget.retrofithelper.rxsubscriber.ProgressObserver;

@CreateModel(ListeningSettingModel.class)
public class ListeningSettingViewModel extends ListeningSettingContract.ViewModel{
    @Override
    public void determineListeningSetting(Map<String, Object> map) {
        mModel.determineListeningSetting(map).subscribe(new ProgressObserver<String>(true,this) {
            @Override
            public void _onNext(String s) {
                mView.returnDetermineListeningSetting(s);
            }
        });
    }

    @Override
    public void getDetermineListeningSetting(Map<String, Object> map) {
        mModel.getDetermineListeningSetting(map).subscribe(new ProgressObserver<ListeningSettingBean>(true,this) {
            @Override
            public void _onNext(ListeningSettingBean data) {
                mView.returnSettingData(data);
            }
        });
    }
}
